﻿<%@ Page Title="" Language="C#" MasterPageFile="~/MasterPageMcSigAdmin.master" AutoEventWireup="true"
    CodeFile="ViaticosRegistroViajeProgramadoListado.aspx.cs" Inherits="ViaticosRegistroViajeProgramadoListado" %>

<%@ Register Assembly="DevExpress.Web.v12.2, Version=12.2.6.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a"
    Namespace="DevExpress.Web.ASPxGridView" TagPrefix="dx" %>
<%@ Register Assembly="DevExpress.Web.v12.2, Version=12.2.6.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a"
    Namespace="DevExpress.Web.ASPxEditors" TagPrefix="dx" %>
<%@ Register Assembly="UsrControls" Namespace="UsrControls" TagPrefix="cc1" %>
<%@ Register Assembly="DevExpress.Web.v12.2, Version=12.2.6.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a"
    Namespace="DevExpress.Web.ASPxGridView.Export" TagPrefix="dx" %>
<%@ Register Assembly="DevExpress.Web.v12.2, Version=12.2.6.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a"
    Namespace="DevExpress.Web.ASPxPopupControl" TagPrefix="dx" %>
<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1" runat="Server">
    c<table width="100%">
        <tr>
            <td>
                <h1 class="contratos">
                    Comisiones</h1>
            </td>
        </tr>
        <tr>
            <td>
                <table style="width: 50%;">
                    <tr>
                        <td colspan="3">
                            <p class="bt-space10">
                                <asp:Label ID="lblInstruccion" runat="server" Text="Para agregar o actualizar la informacion de Comisiones, por favor sobre el boton Nuevo o Actualizar."
                                    CssClass="instruccion"></asp:Label>
                            </p>
                        </td>
                    </tr>
                    <tr>
                        <td width="10%" align="left">
                            <dx:ASPxButton ID="btnNuevo" runat="server" Text="Nueva comision" Theme="SoftOrange"
                                OnClick="btnNuevo_Click" Width="128px" Visible="False">
                            </dx:ASPxButton>
                        </td>
                        <td align="left">
                            <dx:ASPxButton ID="btnActualizar" runat="server" Text="Actualizar Comision" OnClick="btnActualizar_Click"
                                Theme="SoftOrange" Width="136px" Visible="False">
                            </dx:ASPxButton>
                            
                        </td>
                        <td align="left">
                        <dx:ASPxButton ID="btnEliminar" runat="server" Text="Eliminar" Theme="SoftOrange"
                                OnClick="btnEliminar_Click" Width="128px" Visible="False">
                            </dx:ASPxButton>
                        </td>
                    </tr>
                </table>
                <cc1:msgBox ID="msgBox1" runat="server" />
            </td>
        </tr>
        <tr>
            <td>
                <dx:ASPxGridView ID="ASPxGridViewComisiones" ClientInstanceName="ASPxGridViewComisiones"
                    runat="server" AutoGenerateColumns="False" EnableTheming="True" Theme="PlasticBlue"
                    KeyFieldName="COM_ID" ShowFilterBar="Visible" ShowFilterRow="true" Width="100%"
                    OnAutoFilterCellEditorCreate="ASPxGridViewComisiones_AutoFilterCellEditorCreate"
                    OnInit="grid_Init" OnAutoFilterCellEditorInitialize="ASPxGridViewComisiones_AutoFilterCellEditorInitialize"
                    OnProcessColumnAutoFilter="grid_ProcessColumnAutoFilter" OnRowCommand="ASPxGridViewComisiones_RowCommand">
                    <Columns>
                        <dx:GridViewDataTextColumn Caption="Objeto Plan de Viaje" 
                            FieldName="COM_OBJETO_PLAN_VIAJE" VisibleIndex="7" Width="250px">
                            <CellStyle Wrap="True">
                            </CellStyle>
                        </dx:GridViewDataTextColumn>
                        <dx:GridViewCommandColumn ShowSelectCheckbox="True" VisibleIndex="0" Caption="Seleccione"
                            Width="70px">
                        </dx:GridViewCommandColumn>
                        <dx:GridViewDataTextColumn FieldName="COM_ID" VisibleIndex="1" Caption="id" Width="30px">
                        </dx:GridViewDataTextColumn>
                         <dx:GridViewDataTextColumn Caption="SEMAFORO DIAS" 
                                    FieldName="SEMAFORO" VisibleIndex="2">
                                    <DataItemTemplate>
                                        <table style="width: 100%;">
                                            <tr>
                                                <td align="left" valign="top">
                                                    <asp:Image ID="Image1" runat="server" ImageUrl="Imagenes/Botverde.gif" 
                                                        Visible='<%# (Convert.ToDecimal(Eval("SEMAFORO")) < 0 || Convert.ToDecimal(Eval("COE_ID")) >= 10 ) ? true:  false %>' />
                                                    <asp:Image ID="Image2" runat="server" ImageUrl="Imagenes/Botamarillo.gif" 
                                                        Visible='<%# ((Convert.ToDecimal(Eval("SEMAFORO")) >= 0 && Convert.ToDecimal(Eval("SEMAFORO")) <= 3 ) && Convert.ToDecimal(Eval("COE_ID")) < 10 )  ? true:  false %>' />
                                                    <asp:Image ID="Image3" runat="server" ImageUrl="Imagenes/Botrojo.gif" 
                                                        Visible='<%# (Convert.ToDecimal(Eval("SEMAFORO")) > 3 &&  Convert.ToDecimal(Eval("COE_ID")) < 10)  ? true:  false %>' />
                                                </td>
                                                <td align="center" valign="top">
                                                    <asp:Label ID="label1" runat="server" 
                                                        Text='<%# Eval("SEMAFORO")  %>'></asp:Label>
                                                </td>
                                            </tr>
                                        </table>
                                    </DataItemTemplate>
                                </dx:GridViewDataTextColumn>
                       
                        <dx:GridViewDataTextColumn FieldName="CCO_NOMBRE" VisibleIndex="5" 
                            Caption="Nombre ">
                            <Settings AutoFilterCondition="Contains" />
                        </dx:GridViewDataTextColumn>

                        
                        <dx:GridViewDataTextColumn FieldName="COE_ID" VisibleIndex="17" 
                            Caption="ID_ESTADO ">
                            <Settings AutoFilterCondition="Contains" />
                        </dx:GridViewDataTextColumn>
                        <dx:GridViewDataTextColumn FieldName="CCO_IDENTIFICACION" VisibleIndex="8" 
                            Caption="Cédula">
                            <Settings AutoFilterCondition="Contains" />
                        </dx:GridViewDataTextColumn>
                        <dx:GridViewDataTextColumn FieldName="CTI_NOMBRE" VisibleIndex="9" 
                            Caption="Tipo de plan ">
                            <Settings AutoFilterCondition="Contains" />
                        </dx:GridViewDataTextColumn>
                        <dx:GridViewDataTextColumn FieldName="ZON_ID_ORIGEN" VisibleIndex="10" Caption="Origen"
                            Width="100px">
                            <Settings AutoFilterCondition="Contains" />
                        </dx:GridViewDataTextColumn>
                        <dx:GridViewDataTextColumn FieldName="ZON_ID_DESTINO" VisibleIndex="12" Caption="Destino"
                            Width="130px">
                            <Settings AutoFilterCondition="Contains" />
                        </dx:GridViewDataTextColumn>
                        <dx:GridViewDataTextColumn FieldName="COE_NOMBRE" VisibleIndex="7" 
                            Caption="Estado">
                            <Settings AutoFilterCondition="Contains" />
                        </dx:GridViewDataTextColumn>
                        <dx:GridViewDataTextColumn FieldName="CDP_TIQUETES" VisibleIndex="11" 
                            Caption="CDP_TIQUETES">
                            <Settings AutoFilterCondition="Contains" />
                        </dx:GridViewDataTextColumn>
                        <dx:GridViewDataTextColumn FieldName="CDP_VIATICOS" VisibleIndex="10" 
                            Caption="CDP_VIATICOS">
                            <Settings AutoFilterCondition="Contains" />
                        </dx:GridViewDataTextColumn>
                        <dx:GridViewDataTextColumn FieldName="COM_TIQUETES_VALOR_TOTAL" VisibleIndex="13"
                            Caption="Valor total tiquetes">
                            <PropertiesTextEdit DisplayFormatString="{0:N0}">
                            </PropertiesTextEdit>
                        </dx:GridViewDataTextColumn>
                        <dx:GridViewDataTextColumn FieldName="COM_VIATICOS_VALOR_TOTAL" VisibleIndex="14"
                            Caption="Valor total viáticos">
                            <PropertiesTextEdit DisplayFormatString="{0:N0}">
                            </PropertiesTextEdit>
                        </dx:GridViewDataTextColumn>
                        <dx:GridViewDataTextColumn Caption="Fecha de salida" FieldName="COM_FECHA_SALIDA"
                            VisibleIndex="4">
                            <PropertiesTextEdit DisplayFormatString="dd/MM/yyyy">
                            </PropertiesTextEdit>
                        </dx:GridViewDataTextColumn>
                        <dx:GridViewDataHyperLinkColumn Caption="HISTORICO" FieldName="HISTORICO" 
                            VisibleIndex="15">
                            <DataItemTemplate>
                                <table>
                                    <tr>
                                        <td>
                                            <asp:LinkButton ID="lnkEjecucion" runat="server" Visible='<%# Convert.ToInt32(Eval("HISTORICO")) > 0 ?   true :  false%>'
                                                CommandName="cmdHistorico">Ver Histórico</asp:LinkButton>
                                        </td>
                                    </tr>
                                </table>
                            </DataItemTemplate>
                        </dx:GridViewDataHyperLinkColumn>
                        <dx:GridViewDataTextColumn FieldName="USU_NOMBRE" Caption="Usuario Registra" 
                            VisibleIndex="16">
                        </dx:GridViewDataTextColumn>
                        <dx:GridViewDataTextColumn Caption="Fecha regreso" FieldName="COM_FECHA_REGRESO"
                            VisibleIndex="3">
                            <PropertiesTextEdit DisplayFormatString="dd/MM/yyyy">
                            </PropertiesTextEdit>
                        </dx:GridViewDataTextColumn>
                        <dx:GridViewDataTextColumn Caption="Fecha Registro" 
                            FieldName="COM_FECHA_REGISTRO" VisibleIndex="3">
                        </dx:GridViewDataTextColumn>
                        <dx:GridViewDataTextColumn Caption="Tipo" FieldName="CCO_TIPO" VisibleIndex="6">
                        </dx:GridViewDataTextColumn>
                        <dx:GridViewDataTextColumn Caption="Otros Transporte Terrestre" 
                            FieldName="COM_VIATICOS_VALOR_OTROS_TRANS_TERRESTRE" VisibleIndex="18">
                            <PropertiesTextEdit DisplayFormatString="{0:N0}">
                            </PropertiesTextEdit>
                        </dx:GridViewDataTextColumn>
                    </Columns>
                    <TotalSummary>
                        <dx:ASPxSummaryItem DisplayFormat="{0:N0}" FieldName="COM_VIATICOS_VALOR_TOTAL" ShowInGroupFooterColumn="Valor total viáticos"
                            SummaryType="Sum" />
                        <dx:ASPxSummaryItem DisplayFormat="{0:N0}" FieldName="COM_TIQUETES_VALOR_TOTAL" ShowInGroupFooterColumn="Valor total tiquetes"
                            SummaryType="Sum" />
                            <dx:ASPxSummaryItem DisplayFormat="{0:N0}" FieldName="COM_VIATICOS_VALOR_OTROS_TRANS_TERRESTRE" ShowInGroupFooterColumn="Otros Transporte Terrestre"
                            SummaryType="Sum" />
                    </TotalSummary>
                    <GroupSummary>
                        <dx:ASPxSummaryItem DisplayFormat="{0:N0}" FieldName="COM_VIATICOS_VALOR_TOTAL" ShowInGroupFooterColumn="Valor total viáticos"
                            SummaryType="Sum" />
                        <dx:ASPxSummaryItem DisplayFormat="{0:N0}" FieldName="COM_TIQUETES_VALOR_TOTAL" ShowInGroupFooterColumn="Valor total tiquetes"
                            SummaryType="Sum" />
                    </GroupSummary>
                    <SettingsBehavior EnableCustomizationWindow="True" ColumnResizeMode="Control" />
                    <Settings ShowFilterRow="True" ShowFilterBar="Visible" ShowFilterRowMenu="True" ShowFooter="True"
                        ShowGroupPanel="True" ShowTitlePanel="True" ShowPreview="True" />
                    <SettingsText Title="Comisiones" />
                    <SettingsCookies Enabled="True" />
                </dx:ASPxGridView>
            </td>
        </tr>
        <tr>
            <td>
                <dx:ASPxButton ID="btnExportar" runat="server" Text="Exportar" OnClick="btnExportar_Click"
                    Theme="SoftOrange">
                </dx:ASPxButton>
                <dx:ASPxGridViewExporter ID="gridExport" runat="server" GridViewID="ASPxGridViewComisiones">
                </dx:ASPxGridViewExporter>
                <dx:ASPxPopupControl ID="PopupPanelMotivoRechazo" runat="server" AllowDragging="True"
                    Height="300px" Modal="True" PopupHorizontalAlign="WindowCenter" PopupVerticalAlign="WindowCenter"
                    Width="600px" Text="HISTORICO">
                    <ContentCollection>
                        <dx:PopupControlContentControl ID="PopupControlContentControl1" runat="server" SupportsDisabledAttribute="True">
                            <table style="width: 100%;">
                                <tr>
                                    <td colspan="2">
                                        &nbsp;<dx:ASPxGridView ID="ASPxGridViewHistorico" runat="server" Width="100%" AutoGenerateColumns="False"
                                            KeyFieldName="CCH_ID">
                                            <Columns>
                                                <dx:GridViewDataTextColumn FieldName="CCH_ID" ShowInCustomizationForm="True" VisibleIndex="0">
                                                </dx:GridViewDataTextColumn>
                                                <dx:GridViewDataTextColumn FieldName="CCH_OBSERVACIONES" ShowInCustomizationForm="True"
                                                    VisibleIndex="2">
                                                </dx:GridViewDataTextColumn>
                                                <dx:GridViewDataTextColumn FieldName="USU_NOMBRE" ShowInCustomizationForm="True"
                                                    VisibleIndex="1">
                                                </dx:GridViewDataTextColumn>
                                                <dx:GridViewDataTextColumn FieldName="COE_NOMBRE" ShowInCustomizationForm="True"
                                                    VisibleIndex="3">
                                                </dx:GridViewDataTextColumn>
                                                <dx:GridViewDataTextColumn FieldName="CCH_FECHA" ShowInCustomizationForm="True" VisibleIndex="4">
                                                </dx:GridViewDataTextColumn>
                                            </Columns>
                                        </dx:ASPxGridView>
                                    </td>
                                </tr>
                            </table>
                        </dx:PopupControlContentControl>
                    </ContentCollection>
                </dx:ASPxPopupControl>
            </td>
        </tr>
    </table>
</asp:Content>
